﻿using Microsoft.AspNetCore.Mvc;

namespace Magic.Web.Entry;

/// <summary>
/// 系统配置
/// </summary>
public class SysConfigController : BaseController
{
    private readonly IConfigService _configService;
    public SysConfigController(IConfigService configService)
    {

        _configService = configService;

    }

    [HttpGet("getIndex")]
    public async Task<ConfigListOutPut> GetIndex()
    {
        return await _configService.GetAll();
    }
    /// <summary>
    /// 新增配置分类
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpPost("edit")]
    public async Task Edit(Dictionary<string, dynamic> input)
    {
        await _configService.Edit(input);
    }
    [HttpPost("add")]
    public async Task Add(AddConfigInput input)
    {
        await _configService.Add(input);
    }
}